home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / gas / gassrc02.zoo / post < prev    next >
Text File  |  1991-02-09  |  4KB  |  158 lines

  1. here are some of my fixes for gas 1.38 (and any m68k host):
  2.  
  3. the problem was that AOFF mode was always generating 0 offsets, the following
  4. example
  5. #APP
  6. .text
  7.     movew    d1,a0@(two-one)
  8. .lcomm one,2
  9. .lcomm two,2
  10.  
  11. was being assembled as "movew d1,a0@(0)"
  12.  
  13. the diffs below incorporate the following:
  14.  - diffs from kivinen@JOKER.HUT.FI (Tero Kivinen) fixing a6@(label)
  15.    being assembled as PC relative rather than A6 relative.
  16.  
  17.  - diffs from ntmtv!thompson@AI.MIT.EDU (Mike Thompson) for "bkpt #0"
  18.  
  19.  - diff to expr.c:
  20.     this requires a little explaination.
  21.     the if condition at around line 530 in v1.38 reads
  22.  
  23.   if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol
  24.       || (   expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag
  25.           && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value))
  26.  
  27.       several people have pointed out that this causes seg. faults
  28.       and needs to be patched to
  29.  
  30.       if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol
  31.           || (expressionP->X_subtract_symbol && expressionP->X_add_symbol
  32.               && expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag
  33.           && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value))
  34.  
  35. but doing so always produces zero for expressions such as ``a6@(two-one)''.
  36. (see the #def of "isvar" in m68k.c and its usage for example in the
  37. AOFF case at around line 1509 of m68k.c) , so the
  38. correct condition seems to be just
  39.  
  40.       if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol)
  41.  
  42. (as it was in gas 1.34).
  43.  
  44. with the patches suggested below, it seems to do much better.
  45.  
  46. ---
  47. *** ../gas-1.38/expr.c    Fri Jan  4 13:13:00 1991
  48. --- expr.c    Tue Feb  5 18:48:54 1991
  49. ***************
  50. *** 527,535 ****
  51.          * It is faster to re-cancel them to NULL
  52.          * than to check for this special case.
  53.          */
  54. !       if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol
  55. !           || (   expressionP->X_subtract_symbol->sy_frag==expressionP->X_add_symbol->sy_frag
  56. !           && expressionP->X_subtract_symbol->sy_value==expressionP->X_add_symbol->sy_value))
  57.       {
  58.         expressionP -> X_subtract_symbol    = NULL;
  59.         expressionP -> X_add_symbol        = NULL;
  60. --- 527,533 ----
  61.          * It is faster to re-cancel them to NULL
  62.          * than to check for this special case.
  63.          */
  64. !       if (expressionP -> X_subtract_symbol == expressionP -> X_add_symbol)
  65.       {
  66.         expressionP -> X_subtract_symbol    = NULL;
  67.         expressionP -> X_add_symbol        = NULL;
  68. *** ../gas-1.38/m68k.c    Tue Dec  4 15:50:00 1990
  69. --- m68k.c    Wed Feb  6 09:52:38 1991
  70. ***************
  71. *** 1258,1265 ****
  72.                       long t;
  73.   
  74.                       t=get_num(opP->con1,80);
  75. !                     if(t<1 || t>8 || isvar(opP->con1))
  76. !                         losing++;
  77.                   }
  78.                   break;
  79.   
  80. --- 1258,1271 ----
  81.                       long t;
  82.   
  83.                       t=get_num(opP->con1,80);
  84. !                     if (s[1]!='s') {
  85. !                         if(t<1 || t>8 || isvar(opP->con1))
  86. !                             losing++;
  87. !                     }
  88. !                     else {
  89. !                         if(t<0 || t>7 || isvar(opP->con1))
  90. !                             losing++;
  91. !                     }
  92.                   }
  93.                   break;
  94.   
  95. ***************
  96. *** 1474,1480 ****
  97.                   if(   !issword(nextword)
  98.                      || (   isvar(opP->con1)
  99.                          && (  (   opP->con1->e_siz==0
  100. !                           && flagseen['l']==0)
  101.                          || opP->con1->e_siz==3))) {
  102.   
  103.                       if(opP->reg==PC)
  104. --- 1480,1486 ----
  105.                   if(   !issword(nextword)
  106.                      || (   isvar(opP->con1)
  107.                          && (  (   opP->con1->e_siz==0
  108. !                           && flagseen['l']!=0)
  109.                          || opP->con1->e_siz==3))) {
  110.   
  111.                       if(opP->reg==PC)
  112. ***************
  113. *** 1489,1495 ****
  114.                               break;
  115.                           } else {
  116.                               addword(0x0170);
  117. !                             add_fix('l',opP->con1,1);
  118.                           }
  119.                       } else
  120.                           addword(0x0170);
  121. --- 1495,1501 ----
  122.                               break;
  123.                           } else {
  124.                               addword(0x0170);
  125. !                             add_fix('l',opP->con1,0);
  126.                           }
  127.                       } else
  128.                           addword(0x0170);
  129. ***************
  130. *** 1976,1984 ****
  131.               break;
  132.   
  133.           case 'Q':
  134. !             tmpreg=get_num(opP->con1,10);
  135. !             if(tmpreg==8)
  136. !                 tmpreg=0;
  137.               install_operand(s[1],tmpreg);
  138.               break;
  139.   
  140. --- 1982,1997 ----
  141.               break;
  142.   
  143.           case 'Q':
  144. !             if (s[1]!='s') {
  145. !                 tmpreg=get_num(opP->con1,10);
  146. !                   if(tmpreg==8)
  147. !                     tmpreg=0;
  148. !             }
  149. !             else {
  150. !                 tmpreg=get_num(opP->con1,20);
  151. !                   if(tmpreg==8)
  152. !                     tmpreg=0;
  153. !             }
  154.               install_operand(s[1],tmpreg);
  155.               break;
  156.   
  157. cheers,
  158.